The
Wait Flag
MCI commands
usually return to the user immediately, even if it takes several minutes to
complete the action initiated by the command. You can use the wait (MCI_WAIT)
flag to direct the device to wait until the requested action is completed
before returning control to the application.
For example,
the following play
mciSendString("play mydevice from 0 to 100
wait",
lpszReturnString,
lstrlen(lpszReturnString), NULL);
Note The user can
cancel a wait operation by pressing a break key. By default, this key is CTRL+BREAK. Applications
can redefine this key by using the break